package com.example.newappchildrchinese;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import com.example.newappchildrchinese.base.BaseActivity;

public class MainActivity extends BaseActivity implements View.OnClickListener {

    private ImageView btn_class_1,btn_class_2,btn_class_3,btn_class_4;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        findView();
    }

    private void findView() {
        btn_class_1 = (ImageView) findViewById(R.id.btn_class_1);
        btn_class_2 = (ImageView) findViewById(R.id.btn_class_2);
        btn_class_3 = (ImageView) findViewById(R.id.btn_class_3);
        btn_class_4 = (ImageView) findViewById(R.id.btn_class_4);

        btn_class_1.setOnClickListener(this);
        btn_class_2.setOnClickListener(this);
        btn_class_3.setOnClickListener(this);
        btn_class_4.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        Intent intent = new Intent(this,ClassActivity.class);
        switch (v.getId()){
            case R.id.btn_class_1:
                intent.putExtra("class_id",1);
                break;
            case R.id.btn_class_2:
                intent.putExtra("class_id",2);
                break;
            case R.id.btn_class_3:
                intent.putExtra("class_id",3);
                break;
            case R.id.btn_class_4:
                intent.putExtra("class_id",4);
                break;
        }
        startActivity(intent);
    }
}
